def captureForts(forts):
    maxs = 0
    for i in range(0, len(forts)):
        count = 0
        if forts[i] == 1:
            for j in range(i + 1, len(forts)):
                if forts[j] != 0:
                    break
                if forts[j] == 0:
                    count = count + 1
                if count > maxs and j < len(forts) - 1 and forts[j + 1] == -1:
                    maxs = count
    for i in range(len(forts) - 1, -1, -1):
        count = 0
        if forts[i] == 1:
            for j in range(i - 1, -1, -1):
                if forts[j] != 0:
                    break
                if forts[j] == 0:
                    count = count + 1
                if count > maxs and j > 0 and forts[j - 1] == -1:
                    maxs = count
    return maxs

if __name__ == "__main__":
    forts = [0,0,1,-1]
    print(captureForts(forts))